/*
 * Copyright 2009 XueSong Guo.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.webwheel;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * WebWheel MVC框架的应用程序上下文。
 */
public interface WebContext {

    /**
     * 获得当前的动作所对应的http请求地址。
     * @see cn.webwheel.FilterGroup#bindAction(String, Class)
     * @return http请求地址
     */
    String getPath();

    /**
     * 获得应用程序的主类。
     * @return 应用程序主类
     */
    Main getMain();

    /**
     * 获得servlet上下文
     * @return servlet上下文
     */
    ServletContext getContext();

    /**
     * 获得当前的http请求对象
     * @return http请求对象
     */
    HttpServletRequest getRequest();

    /**
     * 获得当前的http响应对象
     * @return http响应对象
     */
    HttpServletResponse getResponse();
}
